<?
	$view_modes = array(
		'list'=>'List',
		'thumbnails'=>'Thumbnails',
	);
?>

<? foreach ($view_modes as $id=>$name): ?>
	<? if (strlen($filebrowser_viewmode) && $filebrowser_viewmode != $id): ?>
		<li class="<?= $id ?>"><a href="#" onclick="return $(this).getForm().sendPhpr(
			'<?= $this->getEventHandler('onFileBrowserSetViewMode') ?>', 
			{extraFields: {path: '<?= $filebrowser_current_path ?>', mode: '<?= $id ?>'}, 
			update: 'multi', loadIndicator: {show: false},
			onBeforePost: LightLoadingIndicator.show.pass('Loading...'), 
			onComplete: LightLoadingIndicator.hide
			});"><?= $name ?></a></li>
	<? else: ?>
		<li class="active <?= $id ?>"><?= $name ?></li>
	<? endif ?>
<? endforeach ?>

<? if ($filebrowser_allowuploads): ?>
	<li class="right upload" id="file_browser_upload_link">
		<div class="addFileLink" id="filebrowser_file_uploader">
			<a href="#" id="filebrowser_file_upload_link" onclick="new PopupForm('<?= $this->getEventHandler('onLoadResourceUploader') ?>', {ajaxFields: {dir: $('file_browser_current_path').get('value')}}); return false;">Upload file(s)</a>
		</div>

		<input type="hidden" id="file_browser_current_url" value="<?= h($this->filebrowserGetUploadUrl($filebrowser_current_path)) ?>"/>
		<input type="hidden" id="file_browser_current_path" value="<?= h($filebrowser_current_path) ?>"/>
		<input type="hidden" id="file_browser_navigate_handler" value="<?= $this->getEventHandler('onFileBrowserFolderClick') ?>"/>
	</li>
<? endif ?>